﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MDMAPI.Models;
using MDMAPI.DAL;

namespace MDMAPI.Service
{
    public class UserInfoService  
    {
        private UserInfoDAL userInfoDAL = new UserInfoDAL();

         /// <summary>
        /// 添加
        /// </summary>
        /// <param name="contact"></param>
        /// <returns></returns>
        public int Add(UserInfo userInfo)
        {
            return userInfoDAL.Add(userInfo);

        }


        /// <summary>
        /// 根据电话查询
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>    
        public IEnumerable<UserInfo> GetUserInfoByMobile(string mobile)
        {
           return userInfoDAL.GetUserInfoByMobile(mobile);
        }


        /// <summary>
        /// 查询所有用户
        /// </summary>
        /// <returns></returns>
        public IEnumerable<UserInfo> GetListAll()
        {
            return userInfoDAL.GetListAll();
        }

        /// <summary>
        /// 根据电话删除
        /// </summary>
        /// <param name="mobile"></param>
        public int Remove(string mobile)
        {
            return userInfoDAL.Remove(mobile);
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="contact"></param>
        /// <returns></returns>
        public int Update(UserInfo userInfo)
        {
            return userInfoDAL.Update(userInfo);
        }
    }
}